//100296.两个字符串的排列差
//https://leetcode.cn/problems/permutation-difference-between-two-strings/
class Solution {
public:
    int findPermutationDifference(string s, string t) {
        char arr[26] = { 0 };
        int ret = 0;
        int n = s.size();
        for (int i = 0; i < n; ++i) arr[s[i] - 'a'] = i;
        for (int i = 0; i < n; ++i) ret += abs(arr[t[i] - 'a'] - i);
        return ret;
    }
};